import App from './App'
import './js_sdk/ican-H5Api/ican-H5Api'
// #ifndef VUE3
import Vue from 'vue'
import store from './store'
import bootstrap from './core/bootstrap'
import {
	back,
	navTo,
	navTo1,
	showToast,
	showToast1,
	showSuccess,
	showError,
	getShareUrlParams,
} from './core/app'
import {
	setImgUrl
} from "@/utils/util.js"
// import './utils/uni.webview.1.5.4.js'
import getPlatform from './core/platform'

Vue.prototype.$toast = showToast
Vue.prototype.$toast1 = showToast1
Vue.prototype.$success = showSuccess
Vue.prototype.$error = showError
Vue.prototype.$navTo = navTo
Vue.prototype.$navTo1 = navTo1
Vue.prototype.$back = back
Vue.prototype.$getShareUrlParams = getShareUrlParams
Vue.prototype.$getPlatform = getPlatform
Vue.prototype.$setImgUrl = setImgUrl
Vue.config.productionTip = false
App.mpType = 'app'
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
const prePage = () => {
	let pages = getCurrentPages()
	let prePage = pages[pages.length - 2]
	// #ifdef H5
	return prePage
	// #endif
	return prePage.$vm
}
//⭐⭐ main.js 文件
import tabBar from "@/components/tabbar/tabbar.vue"
Vue.component('tabBar', tabBar)
const app = new Vue({
	...App,
	store,
	created: bootstrap
})
if (process.env.NODE_ENV !== 'development') {
	console.log = () => {}
}
Vue.prototype.$api = {
	prePage
}
app.$mount()
//获取 系统环境
store.commit('SET_PLATFORM', getPlatform)
store.dispatch('userBaseInfo', getPlatform)
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif